Page({

  /**
   * 页面的初始数据
   */
  data: {
    iphoneXheight: 85,
    currentData: 0,
    list: [{
      title: '少年中国说',
      content: '今日之责任不在于他人，全在于我少年',
      date: '2020-11-11 10:30'
    }, {
      title: '权利意志',
      content: '但凡杀不死你的，终将会使你更强大',
      date: '2020-11-11 10:30'
    }]
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {
    if (wx.getSystemInfoSync().model != "iPhone X") {
      this.setData({
        iphoneXheight: 65
      })
    }
  },
  //获取当前滑块的index

  bindchange: function(e) {
    const that = this;
    that.setData({
      currentData: e.detail.current
    })
  },
  //点击切换，滑块index赋值
  checkCurrent: function(e) {
    const that = this;
    if (that.data.currentData === e.target.dataset.current) {
      return false;
    } else {
      that.setData({
        currentData: e.target.dataset.current
      })
    }
  },
  jump_NewsDetail: function() {
    wx.navigateTo({
      url: 'NewsDetail/NewsDetail',
    })
  }
})